********************************************************************************
*** Voting for Populism in Europe Replication Files
*** Table 3: ESS Individual Data (Unemployment Benefits) Ref Category Other
*** Figure 5: Marginal Effects of Unemployment Benefits on Vote Choice OLS
*** Figure A1: Marginal Effects of Unemployment Benefits on Vote Choice 
*** Table A13: ESS Individual Data (Unemployment Benefits) Ref Category Main Right
*** Table A14: ESS Individual Data (Unemployment Benefits) OLS
*** Table A15: ESS Individual Data: Post-Crisis, 2002-2016
*** Table A16: ESS Individual Data: China Shock X Post-Crisis, 2002-2016 OLS
*** Table A17: ESS Individual Data: Unemployment Benefits, 2002-2016 Low-Wage Imports
*** Table A18: ESS Individual Data: Low-Wage X Benefits, 2002-2016
*** Table A19: ESS Individual Data: Post-Crisis, 2002-2016
*** Table A20: ESS Individual Data: Low-Wage X Crisis, 2002-2016
*** 
***
*** Required data files: "ess_subsample_econmerged.dta"
***                    
*** 
*** Created by: Thomas Cunningham
*** Date: 5 January 2021
******************************************************************
***  Required installations
* ssc install moremata


clear all
version 16.1
cd ..

use "data/ess/ess_subsample_econmerged.dta", clear

mi import flong,m(imp) id(idno ccode nuts2 year cntry cou survey_year newweight cwdyad nuts2_encoded) clear

mi register imputed rti_region-shock_fgn92 rti_region_L1-shock_fgn92_L1
mi register regular euklems_num essround-foreign_born isco_skill-partynom0

misum shock_china_ind_L1 shock_lowwage_ind_L1  shock_fdi_in_ind_L1 shock_robots_mfg_L1 rti_region_L1 reg_ict_emp_mfg_L1 shock_fgn92_L1, format(%9.3f)

mi xtset, clear 
mi tsset, clear

* Table 3

mi est, post : mlogit partynom0 c.shock_china_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight],  base(0) vce(cluster nuts2_encoded) 
	est sto mnom_other
	
	esttab  mnom_other     /*
	*/	using "output/Table3.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Base Category (Other)), 2002-2016)"\label{ess:mnomother}) 

estimates clear

* Figure 5
mi est, post: reg  pvote_right_pop c.shock_china_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight],  vce(cluster nuts2_encoded)
	est sto m1_right_pop_benint

mimrgns,dydx(benefits_un) at(shock_china_ind_L1=(-1.5(.5)2.5)) predict(default) vsquish noestimcheck cmdmargins

marginsplot, yline(0, lpattern(dash)) ///
	recast(line) ///
	recastci(rarea) ///
	ciopts(fintensity(30)) ///
	xtitle("China Shock", size(small)) ///
	ytitle("Marginal Effect of Unemp. Benefits") ///
	title("Right Populist") ///
	scheme(s1mono) saving(essrightpop08, replace)	
	
	graph export "output/Figure5.pdf", replace

erase "essrightpop08.gph"

estimates clear
 
* Figure A1 
mimrgns,dydx(benefits_un) at(shock_china_ind_L1=(-1.5(.5)2.5)) predict(outcome(4)) vsquish noestimcheck cmdmargins

marginsplot, yline(0, lpattern(dash)) ///
	recast(line) ///
	recastci(rarea) ///
	ciopts(fintensity(30)) ///
	xtitle("China Shock", size(small)) ///
	ytitle("Marginal Effect of Unemp. Benefits") ///
	title("Right Populist") ///
	scheme(s1mono) saving(essrightpop08o, replace)	
	
	graph export "output/appendix/FigureA1.pdf", replace	
	
erase "essrightpop08o.gph"
estimates clear

* Table A13 (Columns 1-4)	
mi est, post : mlogit partynom0 c.shock_china_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight], base(3) vce(cluster nuts2_encoded) 
	est sto mnom_mright	
	
	
	esttab  mnom_mright     /*
	*/	using "output/appendix/TableA13_a.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack  noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Only Party Families (Main Right Base)), 2002-2016)"\label{ess:mnommright}) 

estimates clear
 
* Table A13 Column 5
gen partynomrpop=partynom0
replace partynomrpop=0 if inlist(partynom0, 1,2,3)

mi est, post : mlogit partynomrpop c.shock_china_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight], base(0) vce(cluster nuts2_encoded) 
	est sto mnom_rpopvs	
		
	esttab  mnom_rpopvs     /*
	*/	using "output/appendix/TableA13_b.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack  noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Only Party Families (Non-Right Populist Base)), 2002-2016)"\label{ess:mnomrpopvs}) 
	
estimates clear 

* Table A14 
foreach pty in right_pop main_right main_left left_pop {
    mi est, post: reg  pvote_`pty' c.shock_china_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1  rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight] ,  vce(cluster nuts2_encoded)
	est sto m_`pty'_uncn
}

esttab  m_right_pop_uncn m_main_right_uncn m_main_left_uncn m_left_pop_uncn     /*
	*/	using "output/appendix/TableA14.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Migrant Share" /*
	*/shock_robots_mfg_L1 "Robots Shock" shock_lowwage_ind_L1 "Low-Wage Import Shock" reg_ict_emp_mfg_L1 "ICT") /*
	*/ title("ESS Individual Data, 2002-2016 )"\label{ess:nomig})
	

estimates clear

* Table A15 (Columns 1-4)
mi est, post : mlogit partynom0 c.shock_china_ind_L1##i.postcrisis i.benefits_un  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight],  base(0) vce(cluster nuts2_encoded) 
	est sto mnom_other_pccn
	
	esttab  mnom_other_pccn     /*
	*/	using "output/appendix/Table15_a.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Base Category (Other)), 2002-2016)"\label{ess:mnomother}) 

estimates clear
 
* Table A15 (Column 5)
mi est, post : mlogit partynomrpop c.shock_china_ind_L1##i.postcrisis i.benefits_un  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight], base(0) vce(cluster nuts2_encoded) 
	est sto mnom_rpopvs_pccn	
	

	esttab  mnom_rpopvs_pccn     /*
	*/	using "output/appendix/Table15_b.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack  noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Only Party Families (Non-Right Populist Base)), 2002-2016)"\label{ess:mnomrpopvs}) 
	
estimates clear	
* Table A16 
foreach pty in right_pop main_right main_left left_pop {
    mi est, post: reg  pvote_`pty' c.shock_china_ind_L1##i.postcrisis i.benefits_un shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight] ,  vce(cluster nuts2_encoded)
	est sto m_`pty'_pccn
}

esttab  m_right_pop_pccn m_main_right_pccn m_main_left_pccn m_left_pop_pccn     /*
	*/	using "output/appendix/TableA16.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Migrant Share" /*
	*/shock_robots_mfg_L1 "Robots Shock" shock_lowwage_ind_L1 "Low-Wage Import Shock" reg_ict_emp_mfg_L1 "ICT") /*
	*/ title("ESS Individual Data, 2002-2016 )"\label{ess:nomig})

estimates clear

* Table A17 (Columns 1-4)
mi est, post : mlogit partynom0 c.shock_lowwage_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight],  base(0) vce(cluster nuts2_encoded) 
	est sto lwmnom_other
	
	esttab  lwmnom_other     /*
	*/	using "output/appendix/TableA17_a.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_lowwage_ind_L1 "Lowwage Shock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Base Category (Other)), 2002-2016 \ Low-Wage Imports)"\label{ess:lwmnomother}) 

estimates clear 
* Table A17 (Column 5)
mi est, post : mlogit partynomrpop c.shock_lowwage_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight], base(0) vce(cluster nuts2_encoded) 
	est sto lwmnom_rpopvs	
	

	esttab  lwmnom_rpopvs     /*
	*/	using "output/appendix/TableA17_b.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack  noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_lowwage_ind_L1 "Lowwage Shock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Only Party Families (Non-Right Populist Base)), 2002-2016 \ Low-Wage Imports)"\label{ess:lwmnomrpopvs}) 

estimates clear

* Table A18 
foreach pty in right_pop main_right main_left left_pop {
    mi est, post: reg  pvote_`pty' c.shock_lowwage_ind_L1##i.benefits_un  i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1  rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight] ,  vce(cluster nuts2_encoded)
	est sto m_`pty'_unlw
}

esttab  m_right_pop_unlw m_main_right_unlw m_main_left_unlw m_left_pop_unlw     /*
	*/	using "output/appendix/TableA18.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Migrant Share" /*
	*/shock_robots_mfg_L1 "Robots Shock" shock_lowwage_ind_L1 "Low-Wage Import Shock" reg_ict_emp_mfg_L1 "ICT") /*
	*/ title("ESS Individual Data, 2002-2016 )"\label{ess:nomig})

estimates clear

* Table A19 (Columns 1-4)
mi est, post : mlogit partynom0 c.shock_lowwage_ind_L1##i.postcrisis i.benefits_un  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight],  base(0) vce(cluster nuts2_encoded) 
	est sto lwmnom_other_pclw
	
	esttab  lwmnom_other_pclw     /*
	*/	using "output/appendix/TableA19_a.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_lowwage_ind_L1 "Lowwage Shock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Base Category (Other)), 2002-2016 \ Low-Wage Imports)"\label{ess:pclwmnomother}) 

estimates clear
* Table A19 (Column 5)
mi est, post : mlogit partynomrpop c.shock_lowwage_ind_L1##i.postcrisis i.benefits_un  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight], base(0) vce(cluster nuts2_encoded) 
	est sto lwmnom_rpopvs_pclw	
	
	esttab  lwmnom_rpopvs_pclw     /*
	*/	using "output/appendix/TableA19_b.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack  noomitted starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_lowwage_ind_L1 "Lowwage Shock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Immigration Shock" nace_mfg "Manufacturing Sector" /*
	*/	1.isco_skill "Low-Skill" 2.isco_skill "Low-Mid Skill" 3.isco_skill "High-Mid Skill" 4.isco_skill "High Skill" shock_robots_mfg_L1 "Robots Shock") /*
	*/ title("ESS Individual Data (Multinominal - Only Party Families (Non-Right Populist Base)), 2002-2016 \ Low-Wage Imports)"\label{ess:pclwmnomrpopvs}) 

estimates clear
* Table A20 
foreach pty in right_pop main_right main_left left_pop {
    mi est, post: reg  pvote_`pty' c.shock_lowwage_ind_L1##i.postcrisis  shock_fdi_in_ind_L1 shock_robots_mfg_L1 shock_fgn92_L1 rtimcr offmcr male c.age##c.age eduyrs urban  union relig   i.cwdyad   [pw=newweight] ,  vce(cluster nuts2_encoded)
	est sto m_`pty'_pclw
}

esttab  m_right_pop_pclw m_main_right_pclw m_main_left_pclw m_left_pop_pclw     /*
	*/	using "output/appendix/TableA20.tex", replace /*
	*/ cells(b(star fmt(%9.3f)) se(par))  unstack starlevels(* .1 ** .05 *** .01) stats(N r2 rkf , label("N" "R2" "F-Stat" ) fmt(0 3 3 3 3))/*
	*/ substitute(_cons Constant) nobaselevels drop(*.cwdyad) /*
	*/ rename(1.benefits_un "Unemp. Ben." 1.postcrisis "Post-Crisis" eduyrs "Education" male "Male" age "Age"  /*
	*/ urban "Urban" male "Male" relig "Religiosity" benefits_un "UnemploymentBenefits" /*
	*/ offmcr "Offshore"  rtimcr "RTI" shock_china_ind_L1 "ChinaShock" union "Union" shock_fdi_in_ind_L1 "FDI Shock" shock_fgn92_L1 "Migrant Share" /*
	*/shock_robots_mfg_L1 "Robots Shock" shock_lowwage_ind_L1 "Low-Wage Import Shock" reg_ict_emp_mfg_L1 "ICT") /*
	*/ title("ESS Individual Data, 2002-2016)"\label{ess:nomig})